<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <ul id="nbsl">
        <li>6</li>
        <li>66</li>
        <li>666</li>
        <li>6666</li>
        <li>66666</li>
        <li>666666</li>

    </ul>
    <ol class="haha">
        <li>666666</li>
        <li>66666</li>
        <li>6666</li>
        <li>666</li>
        <li>6</li>
    </ol>

    <script>
        //1.id
        var byId = document.getElementById("nbsl");
        console.log(byId);
        //2.tag
        var byTag = document.getElementsByTagName("ul");
        var gL = byId.getElementsByTagName("li");
        console.log(gL);

        console.log(byTag);
        //3.class
        var byClass = document.getElementsByClassName("haha");
        console.log(byClass);
        //4.selector
        var bySele = document.querySelector("ol");
        console.log(bySele);
        var bySele_2 = document.querySelectorAll("ul");
        console.log(bySele_2);
        //5.<body>
        var gB = document.body;
        console.log(gB);
        //6.html
        var gH = document.documentElement;
        console.log(gH);
    </script>
</body>

</html>